Imports System.Data.SqlClient
Public MustInherit Class Persona
    Private TipoDoc As Integer
    Private NroDoc As String
    Private Apellido As String
    Private Nombre As String
    Private Calle As String
    Private Nro As Integer
    Private Dpto As String
    Private Piso As String
    Private IdBarrio As Integer
    Private Email As String
    Private FechaNac As Date
    Private ObjBarrio As Barrio
    Public Property Barrio() As Barrio
        Get
            Return ObjBarrio
        End Get
        Set(ByVal value As Barrio)
            ObjBarrio = value
        End Set
    End Property
    Public Sub New()
        TipoDoc = 0 ' valores iniciales del atributo
        NroDoc = ""
        Apellido = ""
        Nombre = ""
        Calle = ""
        Nro = 0
        Dpto = ""
        Piso = ""
        IdBarrio = Nothing
        Email = ""
        FechaNac = Nothing
    End Sub
    Public Property FecNacPer() As Date
        Get
            Return FechaNac
        End Get
        Set(ByVal value As Date)
            FechaNac = value
        End Set
    End Property
    Public Property tipodocumentoPer() As Integer
        Get
            Return TipoDoc
        End Get
        Set(ByVal value As Integer)
            TipoDoc = value
        End Set
    End Property
    Public Property NroDocumentoPer() As String
        Get
            Return NroDoc
        End Get
        Set(ByVal value As String)
            NroDoc = value
        End Set
    End Property
    Public Property ApellidoPer() As String
        Get
            Return Apellido
        End Get
        Set(ByVal value As String)
            Apellido = value
        End Set
    End Property
    Public Property NombrePer() As String
        Get
            Return Nombre
        End Get
        Set(ByVal value As String)
            Nombre = (value)
        End Set
    End Property
    Public Property CallePer() As String
        Get
            Return Calle
        End Get
        Set(ByVal value As String)
            Calle = value
        End Set
    End Property
    Public Property NroCallePer() As Integer
        Get
            Return Nro
        End Get
        Set(ByVal value As Integer)
            Nro = value
        End Set
    End Property
    Public Property DptoPer() As String
        Get
            Return Dpto
        End Get
        Set(ByVal value As String)
            Dpto = value
        End Set
    End Property
    Public Property PisoPer() As String
        Get
            Return Piso
        End Get
        Set(ByVal value As String)
            Piso = value
        End Set
    End Property
    Public Property IdBarrioPer() As Integer
        Get
            Return IdBarrio
        End Get
        Set(ByVal value As Integer)
            IdBarrio = value
        End Set
    End Property
    Public Property EmailPer() As String
        Get
            Return Email
        End Get
        Set(ByVal value As String)
            Email = value
        End Set
    End Property

    Public MustOverride Function BuscarDatos(ByRef con As ConexionBD) As DataSet
    Public MustOverride Function Buscar(ByVal tipoDoc As Integer, ByVal numDoc As String, ByRef con As ConexionBD) As Boolean

    Protected Function BuscarTelefonos(ByVal con As ConexionBD) As DataSet
        Dim telefonos As DataSet = New DataSet()
        Dim sql As String = ""
        Dim adapter As SqlDataAdapter = Nothing
        Dim datos As DataSet = New DataSet()

        sql = "select decrip,nrotel" + _
              "  from telefonoxpersona tp inner join tipotelefono tel on tp.idtipotel = tel.idtipotel " + _
              "  where nrodoc = '{0}' and idtipodoc ={1}"
        sql = String.Format(sql, NroDoc, TipoDoc)
        adapter = New SqlDataAdapter(sql, con.ConexionBase)

        adapter.Fill(telefonos, "telefonos")


        Return telefonos
    End Function
    
End Class
